import { IGetDecisionFlowNodeVariablesRes } from '@/api';
import { MciSubCard } from '@/components/base';
// import { useFormMode } from '@/components/base/Form/mode';
// import { useCurrentNode } from '@/hooks/useCurrentNode';
import { useGraph } from '@/hooks/useGraph';
// import { useDictStore } from '@/store/dict';
import { activeNodeId } from '../BaseNode/state';
import './index.scss';
import AutomaticForm from './components/AutomaticForm/index.vue';

export const NodeAutomaticForm = defineComponent({
  setup() {
    const variables = ref<IGetDecisionFlowNodeVariablesRes>([]);
    // const dictStore = useDictStore();
    const { graph } = useGraph();
    // const currentNode = useCurrentNode();
    // const formMode = useFormMode();

    onMounted(() => {
      // dictStore.getDictFieldType();
      const node = graph.value?.getCellById(activeNodeId.value);
      variables.value = node?.getData()?.variables || [];
    });

    return () => {
      return (
        <div onClick={(e) => e.stopPropagation()} class="flex flex-col">
          <div class="operation-left flex flex-col">
            <MciSubCard class="py-8" title="自动处理设置">
              <AutomaticForm />
            </MciSubCard>
          </div>
        </div>
      );
    };
  }
});
